package cn.tedu.finance.service.impl;

import cn.tedu.finance.mapper.PaymentMapper;
import cn.tedu.finance.pojo.dto.PaymentQuery;
import cn.tedu.finance.pojo.dto.PaymentSaveParam;
import cn.tedu.finance.pojo.vo.PaymentVO;
import cn.tedu.finance.service.PaymentService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
public class PaymentServiceImpl implements PaymentService {
    @Autowired
     PaymentMapper paymentMapper;
    @Override
    public List<PaymentVO> selectPayment(PaymentQuery paymentQuery) {
        log.debug("查询付款申请业务:{}", paymentQuery);
        List<PaymentVO> list = paymentMapper.selectPayment(paymentQuery);
        return list;
    }

    @Override
    public void savePayment(PaymentSaveParam paymentSaveParam) {
        log.debug("保存付款申请业务:{}", paymentSaveParam);
        paymentMapper.savePayment(paymentSaveParam);
    }

    @Override
    public void cancelPayment(Long id) {
        log.debug("取消付款申请业务:{}", id);
        paymentMapper.cancelPayment(id);
    }
}
